﻿#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include <QMessageBox>

#include "log/log.h"
#include "user_db.h"
#include "account_db.h"

namespace Ui {
class login;
}

class login : public QWidget, public log
{
    Q_OBJECT

public:
    explicit login(QWidget *parent = nullptr, QString db_name = NULL);
    ~login();

    user_db *user_info_db;
    account_db *account_info_db;
    char Check_Legality();
    void creat_table(QString table_name);
private slots:
    void on_pushButton_clicked();

    void on_pushButton_3_clicked();

private:

    Ui::login *ui;
    QString login_user;
    QString login_password;

    QSqlDatabase user_db_instance ; //存储用户信息的数据库
    QSqlDatabase gb_db ; //gift book 存储单个簿子信息的数据库

//    QStringList find_account(QSqlDatabase db);
signals:
    void login_success(QString, account_db*);
};

#endif // LOGIN_H
